package com.github.hwangrq.myrpc.consumer.controller;

import com.github.hwangrq.myrpc.api.pojo.Order;
import com.github.hwangrq.myrpc.api.pojo.User;
import com.github.hwangrq.myrpc.api.service.IOrderService;
import com.github.hwangrq.myrpc.api.service.IUserService;
import com.github.hwangrq.myrpc.consumer.anno.RpcReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hwangrq
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @RpcReference
    private IOrderService orderService;

    @GetMapping("get/{id}")
    public Order getOrderById(@PathVariable String id) {
        return orderService.getOrderById(id);
    }
}
